1. Field of the Invention
The present invention generally relates to computer systems and emulation, and more particularly to dynamic binary translators which use isoblocks to cache translated code.
2. Description of the Related Art
It is often useful to run a computer program designed for one computer system having a particular processor architecture and operating system (OS) on another computer system having a different processor architecture and/or OS. For example, it is desirable to allow new computer systems to run legacy programs without having to redesign those programs. It takes a significant amount of time (and thus cost) to port an older software application to a new platform. If there is a change in the hardware instruction set, then the application must be recompiled. If there is a change in the OS, then applications must be rewritten to use the new OS calls. Significant changes could be required in the source code just to get the application to do what it did before, without adding any new functionality. In many cases, the cost to port an application may be as much as 40% of the original development cost. If the application was obtained from an outside vendor then, even if the source is available, the understanding of the application's architecture and logic are not necessarily available to the programmers who will be porting the application. If the source for the original application was lost, then porting is not even possible. Reverse engineering or starting development from scratch are also expensive alternatives.
Computer emulation provides a means for a native (target) computer system to execute programs designed for otherwise incompatible systems. An emulator is hardware and/or software that duplicates the functions of the original (subject) computer system in the target computer system, so that the behavior of the target system closely resembles the behavior of the subject system. One method of computer emulation known as binary translation takes a sequence of executable code (a set of binary instructions) from the subject environment and translates it into a sequence of executable code adapted for the target environment. The code sequence may be a basic block, i.e., a portion of the code with certain desirable properties that make it highly amenable to analysis. Compilers usually decompose programs into their basic blocks as a first step in the analysis process. Basic blocks form the vertices or nodes in a control flow graph. The code in a basic block typically has one entry point, meaning no code within it is the destination of a jump instruction anywhere in the program, and one exit point, meaning only the last instruction can cause the program to begin executing code in a different basic block. Under these circumstances, whenever the first instruction in a basic block is executed, the rest of the instructions are necessarily executed exactly once, in order.